/*
 * XML Type:  PresentmentDetail
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.PresentmentDetail
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML PresentmentDetail(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class PresentmentDetailImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements net.ofx.types.x2003.x04.PresentmentDetail
{
    
    public PresentmentDetailImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName BILLID$0 = 
        new javax.xml.namespace.QName("", "BILLID");
    private static final javax.xml.namespace.QName PRESACCTFROM$2 = 
        new javax.xml.namespace.QName("", "PRESACCTFROM");
    private static final javax.xml.namespace.QName BILLDETAILTABLE$4 = 
        new javax.xml.namespace.QName("", "BILLDETAILTABLE");
    
    
    /**
     * Gets the "BILLID" element
     */
    public java.lang.String getBILLID()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(BILLID$0, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "BILLID" element
     */
    public net.ofx.types.x2003.x04.IdType xgetBILLID()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.IdType target = null;
            target = (net.ofx.types.x2003.x04.IdType)get_store().find_element_user(BILLID$0, 0);
            return target;
        }
    }
    
    /**
     * Sets the "BILLID" element
     */
    public void setBILLID(java.lang.String billid)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(BILLID$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(BILLID$0);
            }
            target.setStringValue(billid);
        }
    }
    
    /**
     * Sets (as xml) the "BILLID" element
     */
    public void xsetBILLID(net.ofx.types.x2003.x04.IdType billid)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.IdType target = null;
            target = (net.ofx.types.x2003.x04.IdType)get_store().find_element_user(BILLID$0, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.IdType)get_store().add_element_user(BILLID$0);
            }
            target.set(billid);
        }
    }
    
    /**
     * Gets the "PRESACCTFROM" element
     */
    public net.ofx.types.x2003.x04.PresentmentAccount getPRESACCTFROM()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PresentmentAccount target = null;
            target = (net.ofx.types.x2003.x04.PresentmentAccount)get_store().find_element_user(PRESACCTFROM$2, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "PRESACCTFROM" element
     */
    public boolean isSetPRESACCTFROM()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(PRESACCTFROM$2) != 0;
        }
    }
    
    /**
     * Sets the "PRESACCTFROM" element
     */
    public void setPRESACCTFROM(net.ofx.types.x2003.x04.PresentmentAccount presacctfrom)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PresentmentAccount target = null;
            target = (net.ofx.types.x2003.x04.PresentmentAccount)get_store().find_element_user(PRESACCTFROM$2, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.PresentmentAccount)get_store().add_element_user(PRESACCTFROM$2);
            }
            target.set(presacctfrom);
        }
    }
    
    /**
     * Appends and returns a new empty "PRESACCTFROM" element
     */
    public net.ofx.types.x2003.x04.PresentmentAccount addNewPRESACCTFROM()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PresentmentAccount target = null;
            target = (net.ofx.types.x2003.x04.PresentmentAccount)get_store().add_element_user(PRESACCTFROM$2);
            return target;
        }
    }
    
    /**
     * Unsets the "PRESACCTFROM" element
     */
    public void unsetPRESACCTFROM()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(PRESACCTFROM$2, 0);
        }
    }
    
    /**
     * Gets array of all "BILLDETAILTABLE" elements
     */
    public net.ofx.types.x2003.x04.BillDetailTable[] getBILLDETAILTABLEArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(BILLDETAILTABLE$4, targetList);
            net.ofx.types.x2003.x04.BillDetailTable[] result = new net.ofx.types.x2003.x04.BillDetailTable[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "BILLDETAILTABLE" element
     */
    public net.ofx.types.x2003.x04.BillDetailTable getBILLDETAILTABLEArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BillDetailTable target = null;
            target = (net.ofx.types.x2003.x04.BillDetailTable)get_store().find_element_user(BILLDETAILTABLE$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "BILLDETAILTABLE" element
     */
    public int sizeOfBILLDETAILTABLEArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(BILLDETAILTABLE$4);
        }
    }
    
    /**
     * Sets array of all "BILLDETAILTABLE" element
     */
    public void setBILLDETAILTABLEArray(net.ofx.types.x2003.x04.BillDetailTable[] billdetailtableArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(billdetailtableArray, BILLDETAILTABLE$4);
        }
    }
    
    /**
     * Sets ith "BILLDETAILTABLE" element
     */
    public void setBILLDETAILTABLEArray(int i, net.ofx.types.x2003.x04.BillDetailTable billdetailtable)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BillDetailTable target = null;
            target = (net.ofx.types.x2003.x04.BillDetailTable)get_store().find_element_user(BILLDETAILTABLE$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(billdetailtable);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "BILLDETAILTABLE" element
     */
    public net.ofx.types.x2003.x04.BillDetailTable insertNewBILLDETAILTABLE(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BillDetailTable target = null;
            target = (net.ofx.types.x2003.x04.BillDetailTable)get_store().insert_element_user(BILLDETAILTABLE$4, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "BILLDETAILTABLE" element
     */
    public net.ofx.types.x2003.x04.BillDetailTable addNewBILLDETAILTABLE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BillDetailTable target = null;
            target = (net.ofx.types.x2003.x04.BillDetailTable)get_store().add_element_user(BILLDETAILTABLE$4);
            return target;
        }
    }
    
    /**
     * Removes the ith "BILLDETAILTABLE" element
     */
    public void removeBILLDETAILTABLE(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(BILLDETAILTABLE$4, i);
        }
    }
}
